﻿<!DOCTYPE HTML>
<html lang="zh">
<head>
<title>SetStoreCapsLockMode - 语法 &amp; 使用 | AutoHotkey v2</title>
<meta name="description" content="The SetStoreCapsLockMode function determines whether to restore the state of the CapsLock key after a Send function." />
<meta name="ahk:equiv-v1" content="commands/SetStoreCapslockMode.htm" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
<script type="text/javascript">$(function(){0<=window.navigator.userAgent.toLowerCase().indexOf("ucbrowser")&&CaoNiMaDeUc()})</script>
</head>
<body>

<h1>SetStoreCapsLockMode</h1>

<p>Whether to restore the state of <kbd>CapsLock</kbd> after a <a href="Send.htm">Send</a>.</p>

<pre class="Syntax"><span class="func">SetStoreCapsLockMode</span> OnOff</pre>
<h2 id="Parameters">参数</h2>
<dl>

  <dt>OnOff</dt>
  <dd>
    <p>类型: <a href="../Concepts.htm#strings">字符串</a>或<a href="../Concepts.htm#boolean">整数(布尔值)</a></p>
    <p>下列值之一:</p>
    <p><strong>On</strong> or 1 (<a href="../Variables.htm#True">true</a>): This is the initial setting for all scripts: The <kbd>CapsLock</kbd> key will be restored to its former value if <a href="Send.htm">Send</a> needed to change it temporarily for its operation.</p>
    <p><strong>Off</strong> or 0 (<a href="../Variables.htm#False">false</a>): The state of the <kbd>CapsLock</kbd> key is not changed at all. As a result, <a href="Send.htm">Send</a> will invert the case of the characters if <kbd>CapsLock</kbd> happens to be ON during the operation.</p>
  </dd>

</dl>

<h2 id="Remarks">备注</h2>
<p>This means that the <kbd>CapsLock</kbd> key will not always be turned off for <a href="Send.htm">Send</a> and <a href="ControlSend.htm">ControlSend</a>. Even when it is successfully turned off, it might not get turned back on after the keys are sent.</p>
<p>This function is rarely used because the default behavior is best in most cases.</p>
<p>This setting is ignored by <a href="Send.htm#blind">blind mode</a> and <a href="Send.htm#SendText">text mode</a>; that is, the state of <kbd>CapsLock</kbd> is not changed in those cases.</p>
<p>The built-in variable <strong>A_StoreCapsLockMode</strong> contains the current setting (1 or 0).</p>
<p>每个新运行的<a href="../misc/Threads.htm">线程</a>(如 <a href="../Hotkeys.htm">热键</a>, <a href="../objects/Menu.htm">自定义菜单项</a>或<a href="SetTimer.htm">定时</a>子程序) 都会以此函数的默认设置开始. 这个默认设置可以通过在脚本的自动执行段(脚本的顶部) 使用此函数来改变.</p>
<h2 id="Related">相关</h2>
<p><a href="SetNumScrollCapsLockState.htm">SetCaps/Num/ScrollLockState</a>, <a href="Send.htm">Send</a>, <a href="ControlSend.htm">ControlSend</a></p>
<h2 id="Examples">示例</h2>
<div class="ex" id="ExBasic">
<p><a href="#ExBasic">#1</a></p>
<pre>SetStoreCapsLockMode False</pre>
</div>

</body>
</html>